
<template>
    <div class="field-control">
        <SelectControl  :transfer="true" :string="selectString" :disabled="disabled" :data="rangeList" :value="value" @input="$emit('input',$event)">
        </SelectControl>
        <div class="field-message" v-show="!validate">{{message}}</div>
    </div>
</template>
<script>
import $ from "@/common";
import base from "./base";
import SelectControl from "@/element/select";
import Field from "../type";
export default {
  extends: base,
  computed: {
    rangeList() {
      if (this.model.type === "state") {
        return Field.state.parseRangeset(this.model);
      } else {
        if (this.model.rangeset && $.isArray(this.model.rangeset)) {
          return this.model.rangeset;
        }
      }
    },
    selectString() {
      if ($.isArray(this.rangeList)) {
        if (this.rangeList && this.rangeList.length) {
          return typeof this.rangeList[0] === "string";
        } else {
          return true;
        }
      } else {
        return false;
      }
    }
  },
  components: {
    SelectControl
  }
};
</script>
<style lang="less">

</style>
